package com.dxl.web.task;

import org.apache.log4j.Logger;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.dxl.service.sysprop.SysPropCacheManager;

@Component
public class SysPropCacheRefreshTask {
	private static final Logger LOG = Logger.getLogger(SysPropCacheRefreshTask.class);
	
	@Scheduled(cron="0 0/3 * * * ?")
	public void refreshCache() {
		long cur = System.currentTimeMillis();
		try {
			SysPropCacheManager.init();
		} catch (Exception e) {
			LOG.error(e.getMessage(), e);
		}
		LOG.info("刷新SysProp缓存，耗时：" + (System.currentTimeMillis() - cur) + "毫秒");
	}
}
